package com.lj.demo.eduservice.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.lj.demo.eduservice.entity.CourseInfoForm;
import com.lj.demo.eduservice.entity.CoursePublishVo;
import com.lj.demo.eduservice.entity.CourseQuery;
import com.lj.demo.eduservice.entity.EduCourse;
import com.baomidou.mybatisplus.extension.service.IService;
import com.lj.demo.eduservice.entity.vo.CourseQueryVo;
import com.lj.demo.eduservice.entity.vo.CourseWebVo;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 课程 服务类
 * </p>
 *
 * @author liujiang
 * @since 2020-12-03
 */
public interface EduCourseService extends IService<EduCourse> {
    String addCourse(CourseInfoForm courseInfoForm);

    CourseInfoForm getAllById(String id);

    String updateCouAndDesc(CourseInfoForm courseInfoForm);

    CoursePublishVo getCoursePubishById(String id);

    void publishCourse(String id);

    void pageQuery(Page<EduCourse> coursePage, CourseQuery courseQuery);

    void deleteCourseQueryByCourseId(String courseId);

    //根据讲师id查询这个讲师的课程列表
    List<EduCourse> getCourseList(String id);

    //根据条件分页查询课程列表
    Map<String, Object> getCourseWeb(Page<EduCourse> pageCourse, CourseQueryVo courseQueryVo);

    //查询课程信息和讲师信息
    CourseWebVo selectInfoWebById(String courseId);

    /**
     * 更新课程浏览数
     * @param id
     */
    void updatePageViewCount(String id);
}
